

<script>
import formMixin from "@/components/formMixin";

export default {
  name: "AegleCheckbox",
  mixins: [formMixin],
  computed: {
    options() {
      return (this.data && this.data.options) || [];
    },
  },

  created() {
    this.$set(this.aegleForm.form, this.schema.name, []);
  },
  render() {
    if (this.schema) {
      const checkboxs = this.options.map((item) => {
        return (
          <el-checkbox label={item.value} key={item.value}>
            {item.label}
          </el-checkbox>
        );
      });
      return (
        <el-checkbox-group
          v-model={this.model}
          style={{ ...this.style }}
          props={{ ...this.schema.props }}
        >
          {checkboxs}
        </el-checkbox-group>
      );
    }
  },
};
</script>

<style>
</style>